package cn.jishiyu11.xeqb.adapter

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter

/**
 * Created by jsy_zj on 2018-03-05.
 */
class MyPagerStateAdapter(fm: FragmentManager?, dataList:List<Fragment>, titleList:List<String>) : FragmentStatePagerAdapter(fm) {
    var mDataList:List<Fragment>? = null
    var mTitleList:List<String>? = null
    init {
        mDataList = dataList
        mTitleList = titleList
    }

    override fun getItem(position: Int): Fragment {
        return mDataList?.get(position)!!
    }

    override fun getCount(): Int {
        return mDataList?.size!!
    }

    override fun getPageTitle(position: Int): CharSequence {
        return mTitleList?.get(position)!!
    }

}